package com.ssh;

import java.util.HashSet;
import java.util.Set;

public class InValidSudoku_36 {
	public boolean isValidSudoku(char[][] board) {
		Set<String> set = new HashSet<String>();
		for (int i = 0; i < 9; i++) {
			for (int j = 0; j < 9; j++) {
				char c = board[i][j];
				if (c != '.') {
					if (!set.add(c + " hang " + i) || !set.add(c + " lie " + j) || !set.add(c + " kuai " + i/3 + "-" + j/3)) {
						return false;
					}
				}
			}
		}
		return true;
	}
}
